<?php

namespace App\Repository\Repositories;

use App\Models\Pay;
use App\Repository\RepositoryInterface\PaymentInterface;

class PaymentRepositories implements PaymentInterface
{
    /**
     * @return \Illuminate\Http\JsonResponse
     * 支付列表展示
     */
   public function pay()
   {
       // TODO: Implement pay() method.
       $payList =  Pay::lists();
       return response()->json(['code'=>20000,'msg'=>'查询列表展示','data'=>$payList]);
   }

    /**
     * @param $data
     * @return \Illuminate\Http\JsonResponse
     * 支付类型添加
     */
   public function payInsert($data)
   {
       // TODO: Implement payInsert() method.
       Pay::insert($data);
       return response()->json(['code'=>20000,'msg'=>'添加成功','data'=>'']);
   }

    /**
     * @param $id
     * @return \Illuminate\Http\JsonResponse
     * 支付类型删除
     */
   public function payDel($id)
   {
       // TODO: Implement payDel() method.
       Pay::del($id);
       return response()->json(['code'=>20000,'msg'=>'删除成功','data'=>'']);
   }

    /**
     * @param $data
     * @return \Illuminate\Http\JsonResponse
     * 支付类型修改
     */
   public function payUp($data)
   {
       // TODO: Implement payUp() method.
       Pay::up($data);
       return response()->json(['code'=>20000,'msg'=>'修改成功','data'=>'']);
   }
}
